package com.cyclinggle.cloud.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.cyclinggle.cloud.model.User;
import com.cyclinggle.cloud.service.UserFeignService;

import io.swagger.annotations.ApiParam;

@RestController
@RequestMapping("/users")
public class UserController {
	
	@Autowired
	private UserFeignService userFeignService;
	
	@PostMapping("/")
	public String get(@RequestBody @ApiParam(name = "用户", value = "传入json格式", required = true) User user) {
		return "获取用户信息: " + userFeignService.getUser(user);
	}
	
	@PostMapping("/update")
	public String update(@RequestBody @ApiParam(name = "用户", value = "传入json格式", required = true) User user) {
		return userFeignService.update(user);
	}
}
